﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CorporationWars
{
    [Serializable]
    public class GeoLocation
    {
        public string Name { get; set; }
        public string Country { get; set; }
        public string Continent { get; set; }
        public string Hemisphere { get; set; }
        public string Planet { get; set; }

        public GeoLocation() { }

        public GeoLocation(string name, string country, string continent, string hemisphere, string planet = "Earth")
        {
            Name = name;
            Country = country;
            Continent = continent;
            Hemisphere = hemisphere;
            Planet = planet;
        }

        public static GeoLocation GenerateLocation(string name, string planet)
        {
            if (planet == "Earth")
            {
                string hemisphere = NameFactory.GetHemisphere();
                string continent = NameFactory.GetContinentFromHemisphere(hemisphere);
                string country = NameFactory.GetCountryFromContinent(continent);

                return new GeoLocation(name, country, continent, hemisphere, planet);
            }
            else
            {
                return new GeoLocation(name, NameFactory.GetCountry(), "N/A", NameFactory.GetHemisphere(), planet);
            }
        }
    }
}
